From 657c5ca69673e5100ef6143c1a5294e506ff35c1 Mon Sep 17 00:00:00 2001 From: Keir Fraser Date: Wed, 9 Feb 2011 08:44:38 +0000 Subject: [PATCH] cpupool: Strict parameter checking for cpupool operations Some cpupool actions didn't check the cpupool_id exactly. For some actions this doesn't make any sense, so refuse those actions if the specified cpupool doesn't exist. Signed-off-by: Juergen Gross --- xen/common/cpupool.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/xen/common/cpupool.c b/xen/common/cpupool.c index b90e5c0371..16a1f43d29 100644 --- a/xen/common/cpupool.c +++ b/xen/common/cpupool.c @@ -485,7 +485,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) ret = -EBUSY; if ( !cpu_isset(cpu, cpupool_free_cpus) ) goto addcpu_out; - c = cpupool_find_by_id(op->cpupool_id, 0); + c = cpupool_find_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) goto addcpu_out; @@ -501,7 +501,7 @@ int cpupool_do_sysctl(struct xen_sysctl_cpupool_op *op) { unsigned cpu; - c = __cpupool_get_by_id(op->cpupool_id, 0); + c = __cpupool_get_by_id(op->cpupool_id, 1); ret = -ENOENT; if ( c == NULL ) break; -- 2.30.2